import App from './App'
import {get,post,BASE_URL,point} from './network/http'
import {toast,getUrlParam} from '@/utils/Tools.js'
if(getUrlParam(null,'mobile')){
  localStorage.setItem('mobile',getUrlParam(null,'mobile'))
  localStorage.setItem('sign',getUrlParam(null,'sign'))
}
const script = document.createElement('script')
script.src = 'https://img.client.10010.com/mslab/libs/msJSBridge-1.0.2.js'
document.body.appendChild(script)

Vue.config.productionTip = false
Vue.prototype.$get = get
Vue.prototype.$post = post
Vue.prototype.BASE_URL = BASE_URL
Vue.prototype.$toast = toast
Vue.prototype.$point = point
Vue.prototype.$mobile = localStorage.getItem('mobile') || getUrlParam(null,'mobile')
Vue.prototype.$sign = localStorage.getItem('sign') || getUrlParam(null,'sign')
Vue.prototype.$headers = {
  sign: localStorage.getItem('sign') || getUrlParam(null,'sign')
}

uni.request({
  url:`https://api.ipify.org/`,
  method:'GET',
  timeout: 80000,
  success: res => {
    Vue.prototype.$ip = res.data
  }
})

// #ifndef VUE3
import Vue from 'vue'
Vue.config.productionTip = false
App.mpType = 'app'
const app = new Vue({
    ...App
})
app.$mount()
// #endif

// #ifdef VUE3
import { createSSRApp } from 'vue'
export function createApp() {
  const app = createSSRApp(App)
  return {
    app
  }
}
// #endif